using System;

namespace ProjectEuler.Core
{
    public class Problem19 : IProjectEulerProblem
    {
        protected int NumSundays()
        {
            var start = new DateTime(1901, 1, 1);
            var end = new DateTime(2000, 12, 1);
            var sundays = 0;

            for (DateTime d = start; d <= end; d = d.AddMonths(1))
            {
                if(d.DayOfWeek == DayOfWeek.Sunday)
                {
                    sundays++;
                }
            }
            return sundays;
        }

        public int Number
        {
            get { return 19; }
        }

        public string Description
        {
            get { return "How many Sundays fell on the first of the month during the twentieth century?"; }
        }

        public string Answer
        {
            get { return NumSundays().ToString(); }
        }
    }
}